[LINUX] PV-on-HVM: The probe, remove and shutdown methods were added
authorIan Campbell <ian.campbell@xensource.com>
Wed, 25 Oct 2006 12:58:30 +0000 (13:58 +0100)
committerIan Campbell <ian.campbell@xensource.com>
Wed, 25 Oct 2006 12:58:30 +0000 (13:58 +0100)
to struct bus_type in 2.6.16. For older kernels use the methods on the
struct device_driver.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c

index 287e316d1478140e5e32b4096c114b44ec801541..583f44a37650b0694ac70c61b1114deca7dd609f 100644 (file)
@@ -171,9 +171,11 @@ static struct xen_bus_type xenbus_frontend = {
        .bus = {
                .name     = "xen",
                .match    = xenbus_match,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
                .probe    = xenbus_dev_probe,
                .remove   = xenbus_dev_remove,
                .shutdown = xenbus_dev_shutdown,
+#endif
        },
        .dev = {
                .bus_id = "xen",
@@ -334,6 +336,11 @@ int xenbus_register_driver_common(struct xenbus_driver *drv,
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
        drv->driver.owner = drv->owner;
 #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
+       drv->driver.probe = xenbus_dev_probe;
+       drv->driver.remove = xenbus_dev_remove;
+       drv->driver.shutdown = xenbus_dev_shutdown;
+#endif
 
        mutex_lock(&xenwatch_mutex);
        ret = driver_register(&drv->driver);